/*
 +----------------------------------------------------------------------
 + Title        : groupNotice
 + Author       : huwl
 + Version      : 1.0.0
 + Initial-Time : 2024-12-11
 + Last-time    : 这个文件最后修改的时间 + 修改人的名称
 + Desc         : 群公告接口
 +----------------------------------------------------------------------
*/

import type { ApiResponse } from "@/types/global"
import type { GroupNoticeListParams, GroupNoticeListResult, GroupNoticeTotalResult, PublishGroupNoticeParams } from "@/types/groupNotice"
import request from '@/utils/httpRequest'


/**
 * 发布,请求方式[POST]
 * 
 * @param PublishGroupNoticeParams data -------------------请求参数
 * @returns <any, ApiResponse<any>>
 * @author huwl
 */
export const reqPublishGroupNoticeAPI = (data: PublishGroupNoticeParams) => {
    return request<any, ApiResponse<any>>({
        method: 'POST',
        url: 'groupNotice/publish',
        data
    })
}

/**
 * 删除,请求方式[GET]
 * 
 * @param string ids -------------------------------------------请求参数
 * @returns <any, ApiResponse<any>>
 * @author huwl
 */
export const reqDeleteGroupNoticeAPI = (ids: string) => {
    return request<any, ApiResponse<any>>({
        method: 'GET',
        url: 'groupNotice/delete',
        params: {ids}
    })
}

/**
 * 详情,请求方式[GET]
 * 
 * @param number id --------------------------------------------请求参数
 * @returns <any, ApiResponse<any>>
 * @author huwl
 */
export const reqGroupNoticeDetailAPI = (id: number) => {
    return request<any, ApiResponse<any>>({
        method: 'GET',
        url: 'groupNotice/detail',
        params: {id}
    })
}

/**
 * 列表,请求方式[GET]
 * 
 * @param GroupNoticeListParams params -------------------------请求参数
 * @returns <any, ApiResponse<GroupNoticeListResult>>
 * @author huwl
 */
export const reqGroupNoticeListAPI = (params: GroupNoticeListParams) => {
    return request<any, ApiResponse<GroupNoticeListResult>>({
        method: 'GET',
        url: 'groupNotice/list',
        params
    })
}

/**
 * 数量,请求方式[GET]
 * 
 * @param GroupNoticeListParams params -------------------------请求参数
 * @returns <any, ApiResponse<GroupNoticeTotalResult>>
 * @author huwl
 */
export const reqGroupNoticeTotalAPI = (params: GroupNoticeListParams) => {
    return request<any, ApiResponse<GroupNoticeTotalResult>>({
        method: 'GET',
        url: 'groupNotice/total',
        params
    })
}